#include <asm/mach/map.h>
#include "chip.h"
#include <mach/io.h>

struct map_desc fullhan_io_desc[] = {
	{
		.virtual	= VA_CPU_CTRL_REG_BASE,
		.pfn		= __phys_to_pfn(CPU_CTRL_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_CPU_RESET_REG_BASE,
		.pfn		= __phys_to_pfn(CPU_RESET_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_TOP_CTRL_REG_BASE,
		.pfn		= __phys_to_pfn(TOP_CTRL_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_VGS_CRTL_REG_BASE,
		.pfn		= __phys_to_pfn(VGS_CRTL_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_VGS_RSTN_REG_BASE,
		.pfn		= __phys_to_pfn(VGS_RSTN_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_NN_CRTL_REG_BASE,
		.pfn		= __phys_to_pfn(NN_CRTL_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_NN_RSTN_REG_BASE,
		.pfn		= __phys_to_pfn(NN_RSTN_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_CLK_REG_BASE,
		.pfn		= __phys_to_pfn(CLK_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_PIN_REG_BASE,
		.pfn		= __phys_to_pfn(PIN_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_VEU_SYS_CRTL_REG_BASE,
		.pfn		= __phys_to_pfn(VEU_SYS_CRTL_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_VEU_SYS_RSTN_REG_BASE,
		.pfn		= __phys_to_pfn(VEU_SYS_RSTN_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_ISP_SYS_CRTL_REG_BASE,
		.pfn		= __phys_to_pfn(ISP_SYS_CRTL_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_ISP_SYS_RSTN_REG_BASE,
		.pfn		= __phys_to_pfn(ISP_SYS_RSTN_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_DDR_SYS_REG_BASE,
		.pfn		= __phys_to_pfn(DDR_SYS_REG_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_DDR_SYS_RSTN_BASE,
		.pfn		= __phys_to_pfn(DDR_SYS_RSTN_BASE),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_INTC_REG_BASE,
		.pfn		= __phys_to_pfn(INTC_REG_BASE),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_TIMER_REG_BASE,
		.pfn		= __phys_to_pfn(TMR0_REG_BASE),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_UART0_REG_BASE,
		.pfn		= __phys_to_pfn(UART0_REG_BASE),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_UART1_REG_BASE,
		.pfn		= __phys_to_pfn(UART1_REG_BASE),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_UART2_REG_BASE,
		.pfn		= __phys_to_pfn(UART2_REG_BASE),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	},
	{
		.virtual	= VA_UART3_REG_BASE,
		.pfn		= __phys_to_pfn(UART3_REG_BASE),
		.length		= SZ_16K,
	},
	{
		.virtual    = _VA_EPHY_REG_BASE,
		.pfn        = __phys_to_pfn(EPHY_REG_BASE),
		.length     = SZ_16K,
		.type       = MT_DEVICE,
	},

};

static inline void fullhan_map_io(void)
{
	iotable_init(fullhan_io_desc, ARRAY_SIZE(fullhan_io_desc));
}

